﻿using GC_FFW.Common.Abstractions.Interfaces.Helpers;
using GC_FFW.ForecastWriterClient.Abstractions.Interfaces.Factories.ViewModel;
using GC_FFW.ForecastWriterClient.ViewModels;
using GC_FFW.ForecastWriterClient.ViewModels.Parameters;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Services;

namespace GC_FFW.ForecastWriterClient.Factories.ViewModel
{
	public class ImportDataManagerViewModelFactory : IImportDataManagerViewModelFactory
	{
		#region Variables

		private readonly IBrowserDialog _browserDialog;
		private readonly IImportService _importService;

		#endregion

		#region Constructors

		public ImportDataManagerViewModelFactory(IBrowserDialog browserDialog, IImportService importService)
		{
			_browserDialog = browserDialog;
			_importService = importService;
		}

		#endregion

		#region IImportDataManagerViewModelFactory Members

		public ImportDataManagerViewModel Create(ImportDataManagerViewModelParameters parameters)
		{
			if (parameters != null)
			{
				parameters.BrowserDialog = _browserDialog;
				parameters.ImportService = _importService;
			}
			return new ImportDataManagerViewModel(parameters);
		}

		#endregion
	}
}
